public class Euler63 {

public static void main(String args[]){
int count=0;
int limit=10; int pow=1;
int min=1;
while(true){
while(  Math.pow(min, pow)<limit && min<10){ count++; min++;}
min=0;
limit*=10;
pow++;
System.out.println(count);
}
//System.out.println(count);
}

}